<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input{width: 200px;}
    </style>
</head>
<body>
    用户名：<input type="text" id="user"><span></span>
</body>
<script>
    var Ouser = document.getElementById("user");
    
    Ouser.onblur = function(){
        var reg = /^([\u2E80-\u9FFF]{1,7}|[a-zA-Z]{14})$/;
        if(reg.test(this.value)){
            this.nextElementSibling.innerHTML = "验证成功";
        }else{
            this.nextElementSibling.innerHTML = "用户名规则：最多7个汉字 或者 14个英文字母  只能有14个字符";
        }
    }
</script>
</html>